import RPi.GPIO as GPIO
import time

makerobo_RelayPin = 11

def makerobo_setup(Rpin,Gpin,Bpin):
    GPIO.setmode(GPIO.BOARD)  # 采用物理编号
    GPIO.setwarnings(False)  # 去除GPIO的警告
    GPIO.setup(makerobo_RelayPin, GPIO.OUT)  # 列表中都为out
    GPIO.output(makerobo_RelayPin, GPIO.LOW)  # pin都为low

def loop():
    while True:
        GPIO.output(makerobo_RelayPin, GPIO.HIGH)  # pin都为low
        time.sleep(1)
        GPIO.output(makerobo_RelayPin, GPIO.LOW)  # pin都为low
        time.sleep(1)

def destroy():
    GPIO.output(makerobo_RelayPin, GPIO.LOW)
    GPIO.cleanup()  #释放资源

if __name__=='__main__':
    try:
        loop()
    except KeyboardInterrupt:   #按下 ctrl+c 释放资源
        destroy()